The present disclosure generally relates to the field of computing. More particularly, an embodiment of the invention generally relates to techniques for speeding up Galois Counter Mode (GCM) computations.
In cryptography, a block cipher may be a symmetric key cipher which operates on fixed-length groups of bits referred to as “blocks.” For example, during encryption, a block cipher may take a 128-bit block of plaintext as input and output a corresponding 128-bit block of ciphertext in accordance with a secret key. For decryption, the 128-bit block of ciphertext and the secret key may be used to determine the original 128-bit block of plaintext.
GCM is a mode of operation for symmetric key cryptographic block ciphers. Generally, GCM is defined for block ciphers with a block size of 128 bits. GCM may involve two operations. First, the output of a block cipher may be multiplied by a hash key in a finite field. Second, the multiplication result may be reduced in size.
One current software-based GCM technique may utilize table lookups. However, building and storing of the tables may be time-consuming and resource intensive. For example, the tables may not readily fit into a level 1 (L1) cache of a processor and may require access to memory off chip, which in turn introduces latency. Other approaches may utilize a hardware-based technique, for example, found in cryptographic processors, which perform the reduction using a tree of exclusive OR (XOR) gates specific to the polynomial of the finite field. This approach is field specific and cost-prohibitive for some implementations.
Accordingly, current techniques for performing computations associated with GCM may be time-consuming and/or cost-prohibitive.